<?php

    class x_log {
    	protected $db_man;
    	protected $select = "select data, text from x_log";
    	protected $delete = "delete from x_log";
    	protected $insert = "insert into x_log(data, text) values (now(), '%s')";
    	
    	function x_log($dbm) {
    		$this->db_man = $dbm;
    	}
    	
    	function clear_log() {
    		return ($this->db_man->do_dml($this->delete));
    	}
    	
    	function get_log() {
    		$csr = $this->db_man->do_query($this->select);
    		return ($csr);
    	}
    	
    	function add_msg($txt) {
    		return ($this->db_man->do_dml(sprintf($this->insert, $txt)));
    	}
    }

?>